using System;
using System.Collections.Generic;
using System.Text;

using Geekees.App.HRAssistant.DataInterface;
using Geekees.App.HRAssistant.Core.Domain;
using Geekees.App.HRAssistant.Data.Common;
using Geekees.App.HRAssistant.Data.NHibernateSessionMgmt;

using NHibernate.Criterion;

namespace Geekees.App.HRAssistant.Data
{
	public class UserDao : AbstractNHibernateDao<User, int>, IUserDao
	{
		public UserDao( string sessionFactoryConfigPath ) : base( sessionFactoryConfigPath ) { }

		#region IUserDao Members

		public List<User> GetActivedUsers( int startRow, int maxRows, string[] asc, string[] desc, out int totalRows )
		{
			List<ICriterion> cris = new List<ICriterion>();
			//cris.Add( Restrictions.Eq( User.PROP_ACTIVED, true ) );
			List<User> Users = base.Search( new SearchDef( cris ), startRow, maxRows, asc, desc, out totalRows );

			return Users;
		}

		public List<User> GetAllUsers( int startRow, int maxRows, string[] asc, string[] desc, out int totalRows )
		{
			List<ICriterion> cris = new List<ICriterion>();
			List<User> Users = base.Search( new SearchDef( cris ), startRow, maxRows, asc, desc, out totalRows );

			return Users;
		}
		#endregion
	}
}
